#ifndef ENTITYEXPLOSION_H
#define ENTITYEXPLOSION_H

#include "WorldEntity.h"

//!Entity representing an explosion
class CEntityExplosion : public CWorldEntity
{
private:
	//!Index of the explosion animation
	int m_idAnimSprite;

	//!start display time of the current animation's frame.
	int m_animTime;

	//!Sound to play during the explosion
	int m_sound;

	//!Boolean indicating if the animation is over
	bool m_animationOver;

	//!Boolean indicating if the sound has already been played.
	bool m_soundPlayed;

public:
	//!Constructor
	/*!
	\param indexAnimation Animation index of the explosion.
	\param position Position of the explosion
	\param sound Index of the sound to play during the explosion.
	*/
	CEntityExplosion(int indexAnimation, const CVector2i& position, int sound);

	//!Destructor
	~CEntityExplosion();

	//!Update the entity
	void doUpdate(void);

	//!Render the entity
	void doRender(void);

	//!Reset the aniamtion data. Used when the animation to display changed.
	void resetAnimationData(void);
};

#endif


